<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>文件上传</title>
    <link href="css/upload.css" rel="stylesheet" type="text/css"/>
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/layer/layer.js"></script>
</head>
<body>
<div class="header">
    <div class="header-1">
        <a href="javascript:void(0);" class="header-1-1">文件上传</a>
        <ul class="header-1-2">
            <li class="li-active"><a href="javascript:void(0)">市场管理APP</a> </li>
            <li><a href="javascript:void(0)">收费管理APP</a> </li>
        </ul>
    </div>
    <div class="content">
        <div class="content-1 block">
            <div class="content-1-1"><a href="javascript:void(0)" class="a-1">市场管理APP</a> </div>
            <div class="blank"></div>
            <form method="post" id="myform" action="/wape-web/api/core/centerService">
            <div class="content-1-2">
                <table>
                    <tr>
                        <td class="td-1">请选择需要上传的APP</td>
                        <td class="td-2"><input type="file" value="选择文件" id="one" style="cursor: pointer;margin-left: 10px;"></td>
                    </tr>
                </table>
            </div>
            <div class="blank-1"></div>
            <div class="content-1-2">
                <table>
                    <tr>
                        <td class="td-1">请选择version.json</td>
                        <td class="td-2"><input type="file" value="选择文件" id="two" style="cursor: pointer;margin-left: 10px;"></td>
                    </tr>
                </table>
            </div>
            <input type="hidden" name="serviceCode" value="" />
            </form>
            <div class="blank-1"></div>
            <div class="blank-1"></div>
            <div class="content-1-3"><a href="javascript:void(0)" id="market">确认提交</a> </div>
            <div class="blank-1"></div>
        </div>
        <div class="content-1">
            <div class="content-1-1"><a href="javascript:void(0)" class="a-1">收费管理APP</a> </div>
            <div class="blank"></div>
            <form method="post" id="form" action="/wape-web/api/core/centerService">
                <div class="content-1-2">
                    <table>
                        <tr>
                            <td class="td-1">请选择需要上传的APP</td>
                            <td class="td-2"><input type="file" value="选择文件" id="one-2" style="cursor: pointer;margin-left: 10px;"></td>
                        </tr>
                    </table>
                </div>
                <div class="blank-1"></div>
                <div class="content-1-2">
                    <table>
                        <tr>
                            <td class="td-1">请选择version.json</td>
                            <td class="td-2"><input type="file" value="选择文件" id="two-2" style="cursor: pointer;margin-left: 10px;"></td>
                        </tr>
                    </table>
                </div>
                <input type="hidden" name="serviceCode" value="" />
            </form>
            <div class="blank-1"></div>
            <div class="blank-1"></div>
            <div class="content-1-3"><a href="javascript:void(0)" id="market-2">确认提交</a> </div>
            <div class="blank-1"></div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){
        /*tab*/
        $(".header-1-2 li").click(function(){
            $(this).addClass("li-active").siblings().removeClass("li-active");
            $(".content .content-1").addClass("block").siblings().removeClass("block");
            $('.content .content-1:eq('+$(this).index()+')').fadeIn(0).siblings().hide();
        });
        /*提交*/
        $("#market").click(function(){
            layer.confirm('确认提交吗？',{icon:3,title:'市场管理APP'},function(){
                $("#myform").submit();
            });
        });
        $("#market-2").click(function(){
            layer.confirm('确认提交吗？',{icon:3,title:'收费管理APP'},function(){
                $("#form").submit();
            });
        });
        /*表单*/
        $("#myform").submit(function(){
            var app = $("#one").val();
            var ver = $("#two").val();
            if(app == ""){
                layer.msg("请选择APP文件",{shadeClose:true,shade:0.1,time:2000});
                return false;
            }
            else if(ver == ""){
                layer.msg("请选择version.json文件",{shadeClose:true,shade:0.1,time:2000});
                return false;
            }
            else{
                layer.load();
                setTimeout(function(){
                    layer.closeAll();
                    layer.msg("网络异常，请重新尝试！",{shadeClose:true,shade:0.1,time:2000});
                }, 30000);
            }
        });
        $("#form").submit(function(){
            var app2 = $("#one-2").val();
            var ver2 = $("#two-2").val();
            if(app2 == ""){
                layer.msg("请选择APP文件",{shadeClose:true,shade:0.1,time:2000});
                return false;
            }
            else if(ver2 == ""){
                layer.msg("请选择version.json文件",{shadeClose:true,shade:0.1,time:2000});
                return false;
            }
            else{
                layer.load();
                setTimeout(function(){
                    layer.closeAll();
                    layer.msg("网络异常，请重新尝试！",{shadeClose:true,shade:0.1,time:2000});
                }, 30000);
            }
        });
    });
</script>
</html>